import request from '@/router/axios';

/**
 * @param data 新增实体模型
 * */
export const add = (data) => {
    return request({
        url: '/api/manager-api/mx-type/create',
        method: 'post',
        data
    })
}

/**
 * @param data 修改实体模型
 * */
export const update = (data) => {
    return request({
        url: '/api/manager-api/mx-type/update',
        method: 'post',
        data
    })
}

/**
 * @param params 获取实体模型列表 不分页
 * */
export const getEntity = (params) => {
    return request({
        url: '/api/manager-api/mx-type/latestReleaseListIncludedBaseObject',
        method: 'get',
        params
    })
}

/**
 *@param params  获取from 和 to 实体
 * */
 export const from_to = (params) => {
    return request({
        url: '/api/manager-api/mx-type/latestReleaseListIncludedBaseObject',
        method: 'get',
        params
    })
}


/**
 * @param params 获取实体模型列表 分页
 * */
export const getQueryEntity = (params) => {
    return request({
        url: '/api/manager-api/mx-type/page',
        method: 'get',
        params
    })
}
/**
 * @param params 获取实体下的属性
 * */
export const getTypeAllAttributeByName = (params) => {
    return request({
        url: '/api/manager-api/mx-type/getTypeAllAttributeByName',
        method: 'get',
        params
    })
}
/**
 * @param data 发布实体
 * */
export const publish = (data) => {
    return request({
        url: '/api/manager-api/mx-type/publish',
        method: 'post',
        params: data
    })
}

/**
 *
 * @param  params 检出实体
 */
export const checkout = (params) => {
    return request({
        url: '/api/manager-api/mx-type/checkout',
        method: 'post',
        params
    })
}

/**
 *
 * @param  params 修订实体
 */
export const revise = (params) => {
    return request({
        url: '/api/manager-api/mx-type/amendment',
        method: 'post',
        params
    })
}

/**
 *
 * @param  params 检入实体
 */
export const checkin = (params) => {
    return request({
        url: '/api/manager-api/mx-type/checkin',
        method: 'post',
        params
    })
}

/**
 *
 * @param  params 撤销检出实体
 */
export const revokeCheckout = (params) => {
    return request({
        url: '/api/manager-api/mx-type/revokeCheckout',
        method: 'post',
        params
    })
}

/**
 *@param params 获取
 * */
export const getDetail = (params) => {
    return request({
        url: '/api/manager-api/mx-type/detail',
        method: 'get',
        params
    })
}


/**
 * @param params 获取实体模型 不分页
 * */
export const getEntityModules = (params) => {
    return request({
        url: '/api/manager-api/mx-type/allTypeList',
        method: 'get',
        params
    })
}
export const getEntityLatest = (params) => {
    return request({
        url: '/api/manager-api/mx-type/latest',
        method: 'get',
        params
    })
}
export const del = (data) => {
    return request({
        url: '/api/manager-api/mx-type/deleteByIds',
        method: 'post',
        params: data
    })
}
export const discard = (params) => {
    return request({
        url: '/api/manager-api/mx-type/discard',
        method: 'post',
        params
    })
}


/**
 * @param params
 * 查询标签列表
 * */
export const tagList = (params) => {
    return request({
        url: '/api/manager-api/mx-label/list',
        method: 'get',
        params
    })
}


/**
 * @param params
 * 查询功能列表及继承的接口
 * */
export const extends_data = (params) => {
    return request({
        url: '/api/manager-api/mx-interface/getAllLatestInterfaceByTypeName',
        method: 'get',
        params
    })
}


/**
 * @param params
 * 查询所有继承的属性
 * */
export const extends_attribute = (params) => {
    return request({
        url: '/api/manager-api/mx-attribute/listAllAttribute',
        method: 'get',
        params
    })
}


/**
 * @param params
 * API/操作列表
 * */
export const listAllOperation = (params) => {
    return request({
        url: '/api/manager-api/mx-operation/listAllOperation',
        method: 'get',
        params
    })
}


/**
 * @param params
 * 关系列表
 * */
export const getRelationList = (params) => {
    return request({
        url: '/api/manager-api/mx-reference/getAllLatestReferenceByTypeName',
        method: 'get',
        params
    })
}


/**
 * @param params
 * 查询当前功能配置内容 版本
 * */
export const getVersionCon = (params) => {
    return request({
        url: '/api/manager-api/mx-version-rule/getEntity',
        method: 'get',
        params
    })
}


/**
 * @param params
 * 查询当前功能配置内容 编码
 * */
export const getCodeCon = (params) => {
    return request({
        url: '/api/manager-api/mx-code-rule/getEntity',
        method: 'get',
        params
    })
}

/**
 * @param params
 * 查询当前功能配置内容 生命周期
 * */
export const getLifeCon = (params) => {
    return request({
        url: '/api/manager-api/mx-type/listLifeCycleByType',
        method: 'get',
        params
    })
}

/**
 * @param params
 * 查询当前功能配置内容 生命周期
 * */
export const getHistory = (params) => {
    return request({
        url: '/api/manager-api/mx-type/historyPage',
        method: 'get',
        params
    })
}
